home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_getmirror.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  126 lines

  1. # Jones 3D Cog Script
  2. #
  3. # aet_GetMirror.cog
  4. #
  5. # [RT] [TL]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message        activated
  14. message        callback
  15.  
  16.  
  17. # Change these variables ONLY!
  18. # -------------------------------------------------------------------
  19.  
  20. # Use in_pickup_low or in_pickup_med for the "get" keyframe
  21. keyframe    get=in_reach_high.key    local
  22.  
  23. # Item-specific voice line
  24. sound        foundSnd=INXJ106.wav    local
  25.  
  26. # Item bin number
  27. int            bin=50                    local
  28.  
  29. # Added for level specific item
  30. thing        moveMirror
  31.  
  32. cog            hint_cog
  33.  
  34.  
  35. # Don't touch!
  36. # -------------------------------------------------------------------
  37.  
  38. cog            talkCog                    local
  39.  
  40. thing        player                    local
  41. thing        item
  42.  
  43. end
  44.  
  45. # ===================================================================
  46.  
  47. code
  48.  
  49. activated:
  50.  
  51.     player = GetSourceRef();
  52.  
  53.     
  54.     # Disable player controls and stuff
  55.     if (MakeMeStop() == -1)
  56.         return;
  57.     DeselectWeaponWait(player);
  58.  
  59.        # Make sure this pickup is valid
  60.     if (GetInv(player, bin) < GetInvMax(player, bin))
  61.     {
  62.         StartCutscene(0);
  63.  
  64.         # Capture player so we get callback message
  65.         CaptureThing(player);
  66.         # Start the animation
  67.         PlayKey(player, get, 5, 0x12, 0); 
  68.     }
  69.     else
  70.     {
  71.         ClearActorFlags(player, 0x200000);
  72.         return;
  73.     }
  74.  
  75.  
  76.     # Call the Pickup Lines cog
  77.     talkCog = GetCogByIndex(0);
  78.     SendMessage(talkCog, 27);
  79.  
  80.     # Set up the camera
  81.     if (Rand() < 0.5)
  82.     {
  83.         SetExtCamOffset('0.15 -0.05 0.04');
  84.     }
  85.     else
  86.     {
  87.         SetExtCamOffset('-0.15 -0.05 0.04');
  88.     }
  89.     SetExtCamLookOffset('0.0 0.02 0.0');
  90.  
  91.     return;
  92.  
  93. # -------------------------------------------------------------------
  94.  
  95. callback:
  96.  
  97.     ReleaseThing(player);
  98.  
  99.     # Get rid of the item
  100.     DestroyThing(item);
  101.     DestroyThing(moveMirror);
  102.     
  103.     # Add to inventory
  104.     ChangeInv(player, bin, 1.0);
  105.     SetInvAvailable(player, bin, 1);
  106.     JonesInvItemChanged(bin);
  107.  
  108.     SendMessage(hint_cog, user6);
  109.  
  110.     # Wait a bit, then start the voice line
  111.     Sleep(1.0);
  112.     PlayVoice(player, foundSnd, 1.0, 0);
  113.  
  114.     # Reset the camera
  115.     RestoreExtCam();
  116.  
  117.     # Enable player control
  118.     ClearActorFlags(player, 0x200000);
  119.  
  120.     EndCutscene();
  121.  
  122.     return;
  123.  
  124. end
  125.  
  126.